home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 18038 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: news.ios.com!holovacs
  2. From: holovacs@ios.com (Jay Holovacs)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: A LINKed LIST Question
  5. Date: 18 Apr 1996 16:30:55 GMT
  6. Organization: Internet Online Services
  7. Message-ID: <4l5qnv$a7o@news.ios.com>
  8. References: <4l4m21$sr1@falcon.ccs.uwo.ca>
  9. NNTP-Posting-Host: styx.ios.com
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Declare NodeList a friend class.
  13.  
  14. Sharon Wang (swang1@julian.uwo.ca) wrote:
  15. : I have the following def'n
  16.  
  17. : class Node {
  18. :     ItemType item1;  // ItemType define
  19. :     ItemType item2;
  20. :     ...
  21. : public:
  22. :     functions on item;
  23. : };
  24.  
  25. : class NodeList {
  26. :     Node  N;
  27. :     Node* FLink;
  28. :     Node* BLink;
  29. : public:
  30. :     functions on Node;
  31. : };
  32.  
  33. : However, I can't access the members of Node in the list since
  34. : they are "private".  How can I get arount this WIHTOUT using
  35. : access functions in class Node.
  36.  
  37. : Sharon
  38. : <swang1@julian.uwo.ca>
  39.  
  40.  
  41. --
  42. -----------------------------------------------------------------------
  43. Jay Holovacs <holovacs@ios.com>
  44. -----------------------------------------------------------------------
  45. PGP Key fingerprint =  AC 29 C8 7A E4 2D 07 27  AE CA 99 4A F6 59 87 90 
  46.